<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="box">类选择器</div>
    <span>元素选择器</span>
    <a id="it" ,href="#">ID选择器</a>

    <script>
        //类选择器
        var box = document.getElementsByClassName("box")[0]
        box.innerHTML = "JS类选择器"
        //元素选择器
        var span = document.getElementsByTagName("span")[0]
        span.innerHTML="JS元素选择器"
        //ID选择器(ID是唯一的)
        var a = document.getElementById("it");
        a.innerHTML="JSID选择器"
    </script>
</body>

</html>